package P1.shuangzhizhen;

import java.util.Scanner;

/**
 * @Date : 2023-03-01
 * @Description:
 */
public class JudgeChildren {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int [] ar=new int[100010],br=new int[100010];
        int n = sc.nextInt();
        int m = sc.nextInt();
        for (int i = 0; i < n; i++) {
            ar[i]=sc.nextInt();
        }
        for (int i = 0; i < m; i++) {
            br[i]=sc.nextInt();
        }
        int i=0,j=0;
        while(i<n&&j<m){
            if(ar[i]==br[j])i ++;
            j++;
        }
        if(i==n)
            System.out.println("yes");
        else
            System.out.println("no");
    }
}
